// pages/ucenter/myorder/index.js
const app = getApp();
import {
  getOaShopDetailPage
} from "../../../api/buy.js";
Page({

  /**
   * 页面的初始数据
   */
  data: {
    total:0,
    size:0,
    camplist:[],
    datalist: [],
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    TabbarBot: app.globalData.tabbar_bottom,
    TabCur: 0,
    scrollLeft: 0,
    SortMenu: [{
      id: 0,
      name: "全部订单"
    }, {
      id: 1,
      name: "待出行"
    }, {
      id: 2,
      name: "已完成"
    }],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // let id = JSON.parse(options.id);
    this.getOaShopDetailPage()
  },
  getOaShopDetailPage() {
    let data ={
      "pageNum": "1",
      "pageSize": "10",
      "id":null,
      "uaUserId":1,
      "oaShopDetailType":2,
      "oaShopDetailTypeId":null,
      "startTime":null,
      "overTime":null,
      "shopType":1,
      "shopTypeId":null,
      "purchasesNum":null,
      "payState":null,
      "orderState":null,
      "status":null,
      "delFlag":null,
      "createBy":null,
      "createTime":null,
      "updateBy":null,
      "updateTime":null,
      "remark":null
    }
    getOaShopDetailPage(data).then(res => {
      let datalist = res.data.data.records;
      let camplist=[];
      let total=[];
      let size=1;
      // let size=datalist.length;
      datalist.forEach(item=>{
        camplist.push(item.caVenueRental)
        
      })
      console.log('h',camplist)
      // camplist.forEach(item=>{
      //   // total=(Number)(item.lostPrice)
      //   total.push(item.lostPrice)
      //   console.log(item.lostPrice)
      // })
      this.setData({
        camplist: camplist,
        size:size,
      })
    })
  },
  tabSelect(e) {
    this.setData({
      TabCur: e.currentTarget.dataset.id,
      scrollLeft: (e.currentTarget.dataset.id - 1) * 60
    })
  },
  jumpPage(e) {
    wx.navigateTo({
      url: e.currentTarget.dataset.url,
    })
  },
})